//import { api } from '../utils'
import { resolveComponent } from 'vue'
import { useRequest, Result } from './request'

export interface User {
  id: string
  username: string
  name: string
  avatar: string
}

const defaultUser: User = {
  id: '0',
  username: 'Dokutah',
  name: 'Dokutah',
  avatar: ''
}

export const useCurrentUser = (): Result<User> => {
  return useRequest(new Promise<User>(
    (resolve, reject) => { resolve(defaultUser) }
    ) )
}
